package cn.cutie.clotcache.command;

import cn.cutie.clotcache.core.ClotCache;
import cn.cutie.clotcache.core.Command;
import cn.cutie.clotcache.core.Reply;

/**
 * @Description:
 * @Author: Cutie
 * @CreateDate: 2024/6/19 20:15
 * @Version: 0.0.1
 */
public class DelCommand implements Command {
    @Override
    public String name() {
        return "DEL";
    }

    @Override
    public Reply<?> exec(ClotCache cache, String[] args) {
        String[] keys = getKeys(args);
        int ret = cache.del(keys);
        return Reply.integer(ret);
    }
}
